package com.ncloud.billing.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.ncloud.billing.entity.BsDiscnt;

@Mapper
public interface BsDiscntMapper {
	
	@Select(value = {"SELECT discnt_inst_id, discnt_id, discnt_name, prod_inst_id, prod_id, is_base, begin_date, end_date, create_user, create_time, update_time, update_user, remark FROM bs_discnt "
			+ "where prod_inst_id = #{0} "
			+ "and begin_date<#{2} and end_date>#{1} "})
	@Results({ @Result(column = "discnt_inst_id", property = "discnt_inst_id"), @Result(column = "discnt_id", property = "discnt_id"),
         @Result(column = "discnt_name", property = "discnt_name"),@Result(column = "prod_inst_id", property = "prod_inst_id"),
         @Result(column="prod_id",property="prod_id"),@Result(column="is_base",property="is_base"),
         @Result(column="begin_date",property="begin_date"),@Result(column="end_date",property="end_date"),
         @Result(column="create_user",property="create_user"),@Result(column="create_time",property="create_time"),
         @Result(column="update_time",property="update_time"),@Result(column="update_user",property="update_user"),
         @Result(column="remark",property="remark")})
	public List<BsDiscnt> getBsDiscntByProdInstID(Long prod_inst_id,Date begin_date,Date end_date);
} 